-----------------------------------------------------------------------------------------------------------------------
       log:  Z:\interactionmodels\getdata\getdata1xls_mozaffar.log
  log type:  text
 opened on:  10 Jan 2007, 19:57:58

. *     ***************************************************************** *;
. *     ***************************************************************** *;
. *       File-Name:      getdata1xls_mozaffar.do                         *;
. *       Date:           01/09/2007                                      *;
. *       Author:         MRG                                             *;
. *       Purpose:        Recode Mozaffar et al. (2003) EXCEL and relabel.*;
. *       Input File:     mozaffar_xls.dta, golder1.dta                   *;
. *       Output File:    getdata1xls_mozaffar.log                        *;
. *       Data Output:    XLS_mozaffar.dta                                *;
. *       Previous file:                                                  *;
. *       Machine:                                                        *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. set mem 10m;
(10240k)

. use getdata\mozaffar_xls.dta;

. *     ****************************************************************  *;
. *           Summary Statistics                                          *;
. *     ****************************************************************  *;
. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    countrys |         0
        enep |        62    3.234355    2.699867        1.4       14.9
        enlp |        62    2.340323    1.505894          1        8.8
    dismagni |        62    32.18519    79.66943          1        400
    logmagni |        62    .6975806    .7657045          0      2.602
-------------+--------------------------------------------------------
    proxmity |        62    .6246774    .4255131          0          1
      enpres |        62    2.254839    1.489931          0        7.3
    proxenpr |        62    1.442323    1.177821          0        4.6
    ltfragto |        62    4.382419     2.74622          1       9.91
    fragtosq |        62    26.62613    28.37423          1      98.21
-------------+--------------------------------------------------------
      contot |        62    1.597258     .963064          0       3.24
    intertot |        62    8.193395    6.824679          0    25.4664
    intertsq |        62    51.16194    59.53712          0     208.42
    lmgfrgts |        62    21.73133    47.40832          0   182.4051
    lmgconto |        62    1.154228    1.518987          0   5.317299
-------------+--------------------------------------------------------
    lmgtrpls |        62    34.08677    64.67844          0     265.65
         elf |        56      .62625    .2404281          0        .93
       pregb |        62    .4206452     .281692          0        .82
     elflmag |        62    .4157788    .6017939          0   2.289813
    pregblmg |        62    .3235943    .5029105          0   2.003586

. *     ****************************************************************  *;
. *               Recode and relabel variables to sensible names          *;
. *     ****************************************************************  *;
. rename countrys country_xls;

. label var country_xls "country";

. rename enlp legparties_xls;

. label var legparties_xls "effective number of parliamentary parties";

. rename enep elecparties_xls;

. label var elecparties_xls "effective number of electoral parties";

. rename dismagni avemagnitude_xls;

. label var avemagnitude_xls "average district magnitude";

. rename logmagni logmag10_xls;

. label var logmag10_xls "log of average district magnitude (base 10) - NOT natural log";

. rename proxmity proximity_xls;

. label var proximity_xls "temporal proximity of legislative and presidential elections";

. rename enpres prescandidate_xls;

. label var prescandidate_xls "effective number of presidential candidates";

. rename proxenpr prox_prescandidate_xls;

. label var prox_prescandidate_xls "proximity * prescandidate";

. rename ltfragto fragmentation_xls;

. label var fragmentation_xls "fragmentation index (mozaffar 2003)";

. rename fragtosq fragmentation2_xls;

. label var fragmentation2_xls "fragmentation squared";

. rename contot concentration_xls;

. label var concentration_xls "concentration of ethnic groups";

. rename intertot frag_conc_xls;

. label var frag_conc_xls "fragmentation * concentration";

. rename intertsq frag2_conc_xls;

. label var frag2_conc_xls "fragmentation2 * concentration";

. rename lmgtrpls logmag10_frag2_conc_xls;

. label var logmag10_frag2_conc_xls "logmag10 * fragmentation2 * concentration";

. rename elf elf_xls;

. label var elf_xls "ethno-linguistic group index";

. rename elflmag logmag10_elf_xls;

. label var logmag10_elf_xls "logmag10* elf";

. rename pregblmg pregb_logmag10_xls;

. label var pregb_logmag10_xls "pregb * logmag10";

. rename pregb pregb_xls;

. label var pregb_xls "politically relevant ethnic group B count";

. *     ****************************************************************  *;
. *           Create new variables that we might want.                    *;
. *     ****************************************************************  *;
. gen logmag_xls = ln(avemagnitude);

. label var logmag_xls "natural log of average district magnitude";

. *     ****************************************************************  *;
. *       Create necessary interaction terms involving logmag10           *;
. *     ****************************************************************  *;
. gen logmag10_conc_xls = logmag10_xls*concentration_xls;

. label var logmag10_conc_xls "logmag10_xls*concentration_xls";

. gen logmag10_frag_xls = logmag10_xls*fragmentation_xls;

. label var logmag10_frag_xls "logmag10_xls*fragmentation_xls";

. gen logmag10_frag_conc_xls = logmag10_xls*fragmentation_xls*concentration_xls;

. label var logmag10_frag_conc_xls "logmag10_xls * fragmentation_xls * concentration_xls";

. *     ****************************************************************  *;
. *       Now create necessary interaction terms involving logmag         *;
. *     ****************************************************************  *;
. gen logmag_conc_xls = logmag_xls*concentration_xls;

. label var logmag_conc_xls "logmag_xls*concentration_xls";

. gen logmag_frag_xls = logmag_xls*fragmentation_xls;

. label var logmag_frag_xls "logmag_xls*fragmentation_xls";

. gen logmag_frag_conc_xls = logmag_xls*fragmentation_xls*concentration_xls;

. label var logmag_frag_conc_xls "logmag_xls * fragmentation_xls * concentration_xls";

. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
 country_xls |         0
elecpartie~s |        62    3.234355    2.699867        1.4       14.9
legparties~s |        62    2.340323    1.505894          1        8.8
avemagnitu~s |        62    32.18519    79.66943          1        400
logmag10_xls |        62    .6975806    .7657045          0      2.602
-------------+--------------------------------------------------------
proximity_~s |        62    .6246774    .4255131          0          1
prescandid~s |        62    2.254839    1.489931          0        7.3
prox_presc~s |        62    1.442323    1.177821          0        4.6
fragme~n_xls |        62    4.382419     2.74622          1       9.91
fragme~2_xls |        62    26.62613    28.37423          1      98.21
-------------+--------------------------------------------------------
concentrat~s |        62    1.597258     .963064          0       3.24
frag_conc_~s |        62    8.193395    6.824679          0    25.4664
frag2_conc~s |        62    51.16194    59.53712          0     208.42
    lmgfrgts |        62    21.73133    47.40832          0   182.4051
    lmgconto |        62    1.154228    1.518987          0   5.317299
-------------+--------------------------------------------------------
l~2_conc_xls |        62    34.08677    64.67844          0     265.65
     elf_xls |        56      .62625    .2404281          0        .93
   pregb_xls |        62    .4206452     .281692          0        .82
logmag10_e~s |        62    .4157788    .6017939          0   2.289813
pregb_logm~s |        62    .3235943    .5029105          0   2.003586
-------------+--------------------------------------------------------
  logmag_xls |        62    1.606316    1.763218          0   5.991465
logmag10_c~s |        62    1.154257     1.51896          0    5.31634
l~0_frag_xls |        62    3.311054    5.323039          0   20.52978
logmag10_f.. |        62    5.522605      8.2276          0   33.66884
logmag_con~s |        62    2.657708    3.497597          0   12.24354
-------------+--------------------------------------------------------
l~g_frag_xls |        62     7.62432    12.25799          0   47.27266
logmag_fra.. |        62    12.71621    18.94531          0   77.52715

. describe;

Contains data from getdata\mozaffar_xls.dta
  obs:            62                          
 vars:            27                          28 Oct 2003 18:04
 size:         7,502 (99.9% of memory free)
-------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
-------------------------------------------------------------------------------
country_xls     str13  %13s                   country
elecparties_xls float  %9.0g                  effective number of electoral
                                                parties
legparties_xls  float  %9.0g                  effective number of
                                                parliamentary parties
avemagnitude_~s float  %9.0g                  average district magnitude
logmag10_xls    float  %9.0g                  log of average district
                                                magnitude (base 10) - NOT
                                                natural log
proximity_xls   float  %9.0g                  temporal proximity of
                                                legislative and presidential
                                                elections
prescandidate~s float  %9.0g                  effective number of
                                                presidential candidates
prox_prescand~s float  %9.0g                  proximity * prescandidate
fragmenta~n_xls float  %9.0g                  fragmentation index (mozaffar
                                                2003)
fragmenta~2_xls float  %9.0g                  fragmentation squared
concentration~s float  %9.0g                  concentration of ethnic groups
frag_conc_xls   float  %9.0g                  fragmentation * concentration
frag2_conc_xls  float  %9.0g                  fragmentation2 * concentration
lmgfrgts        float  %9.0g                  
lmgconto        float  %9.0g                  
logm~2_conc_xls float  %9.0g                  logmag10 * fragmentation2 *
                                                concentration
elf_xls         float  %9.0g                  ethno-linguistic group index
pregb_xls       float  %9.0g                  politically relevant ethnic
                                                group B count
logmag10_elf_~s float  %9.0g                  logmag10* elf
pregb_logmag1~s float  %9.0g                  pregb * logmag10
logmag_xls      float  %9.0g                  natural log of average district
                                                magnitude
logmag10_conc~s float  %9.0g                  logmag10_xls*concentration_xls
logmag10_~g_xls float  %9.0g                  logmag10_xls*fragmentation_xls
logmag10_frag.. float  %9.0g                  logmag10_xls *
                                                fragmentation_xls *
                                                concentration_xls
logmag_conc_xls float  %9.0g                  logmag_xls*concentration_xls
logmag_frag_xls float  %9.0g                  logmag_xls*fragmentation_xls
logmag_frag_c~s float  %9.0g                  logmag_xls * fragmentation_xls
                                                * concentration_xls
-------------------------------------------------------------------------------
Sorted by:  
     Note:  dataset has changed since last saved

. *     ****************************************************************  *;
. *       Now merge this dataset with goldershort.dta so that we have     *;
. *       variables indicating the year of the election and whether it    *;
. *       was a dictatorship.                                             *;
. *     ****************************************************************  *;
. merge using getdata\golder1.dta, keep(year_nyu dictator_nyu) nokeep;

. drop _merge;

. *     ****************************************************************  *;
. *                           Reorder the data                            *;
. *     ****************************************************************  *;
. order country year_nyu dictator_nyu;

. *     ****************************************************************  *;
. *                                   Save                                *;
. *     ****************************************************************  *;
. save getdata\XLS_mozaffar, replace;
file getdata\XLS_mozaffar.dta saved

.  log close;
       log:  Z:\interactionmodels\getdata\getdata1xls_mozaffar.log
  log type:  text
 closed on:  10 Jan 2007, 19:58:00
-----------------------------------------------------------------------------------------------------------------------
